package blog.service.impl;

import blog.common.Result;
import blog.entity.ArticleType;
import blog.entity.Login;
import blog.mapper.ArticleTypeMapper;
import blog.mapper.LoginMapper;
import blog.service.ArticleTypeService;
import blog.service.LoginService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author jjpzh
 * @since 2023-02-25
 */
@Service
public class ArticleTypeServiceImpl extends ServiceImpl<ArticleTypeMapper, ArticleType> implements ArticleTypeService {

    @Override
    public Result findArticleTypeById(int id) {
        //根据id查询文章类型
        ArticleType articleType = baseMapper.selectById(id);
        if (articleType==null){
            return Result.error("文章类型不存在");
        }
        return Result.success(articleType);
    }
}
